package grape.sequence.rest.config.form;
import grape.common.rest.form.BaseForm;

import grape.common.rest.validation.props.PropValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 序列生成配置
 * </p>
 *
 * @author yangwei
 * @since 2020-08-20
 */
@Data
@PropValid
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="序列生成配置添加表单对象")
public class ConfigCreateForm extends BaseForm {

    private static final long serialVersionUID = 1L;

    @NotEmpty(message="编码不能为空")
    @ApiModelProperty(value = "编码",required = true)
    private String code;

    @NotEmpty(message="名称不能为空")
    @ApiModelProperty(value = "名称",required = true)
    private String name;

    @NotNull(message="周期不能为空")
    @ApiModelProperty(value = "周期",required = true)
    private Integer period;

    @NotEmpty(message="周期单位不能为空")
    @ApiModelProperty(value = "周期单位",required = true)
    private String periodUnitDictId;

    @ApiModelProperty(value = "周期计算初始时间")
    private Boolean isPeriodFormFirstGenerateAt;

    @NotNull(message="初始值不能为空")
    @ApiModelProperty(value = "初始值",required = true)
    private Integer startValue;

    @NotNull(message="步长不能为空")
    @ApiModelProperty(value = "步长",required = true)
    private Integer stepValue;

    @ApiModelProperty(value = "前缀")
    private String prefix;

    @ApiModelProperty(value = "前缀是否拼接周期")
    private Boolean isPrefixWithPeriod;


    @ApiModelProperty(value = "最小长度")
    private Integer minLength;

    @PropValid.Depend(message = "占位字符不能为空",dependProp = "minLength")
    @ApiModelProperty(value = "占位字符")
    private String prepend;

    @ApiModelProperty(value = "备注")
    private String remark;



}
